home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / lib / gcc-lib / i486-unknown-sco3.2v5.0.0elf / 2.6-95q2 / include / oldstyle / tcap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-12  |  9.2 KB  |  285 lines

  1. #ifndef _PARAMS
  2. #if defined(__STDC__) || defined(__cplusplus)
  3. #define _PARAMS(ARGS) ARGS
  4. #else
  5. #define _PARAMS(ARGS) ()
  6. #endif
  7. #endif /* _PARAMS */
  8. /*
  9.  *   Portions Copyright (C) 1983-1995 The Santa Cruz Operation, Inc.
  10.  *        All Rights Reserved.
  11.  *
  12.  *    The information in this file is provided for the exclusive use of
  13.  *    the licensees of The Santa Cruz Operation, Inc.  Such users have the
  14.  *    right to use, modify, and incorporate this code into other products
  15.  *    for purposes authorized by the license agreement provided they include
  16.  *    this notice and the associated copyright notice with any such product.
  17.  *    The information in this file is provided "AS IS" without warranty.
  18.  */
  19.  
  20. /*
  21.  *    Formerly "curses.h", now only included for termcap curses
  22.  *    (as opposed to terminfo curses).
  23.  */
  24. #if defined(WINDOW) && !defined(_TCAP_H)
  25. error "Please define WINDOW only via inclusion of tcap.h"
  26. #endif
  27.  
  28. #ifndef    _TCAP_H
  29. #define    _TCAP_H
  30.  
  31. #ident "oldstyle @(#) tcap.h 20.1 94/12/04 "
  32.  
  33. #pragma   pack(4)
  34.  
  35. #include    <stdio.h>
  36. #include    <termio.h>
  37. #include    <unctrl.h>
  38.  
  39. typedef    struct termio    SGTTY;
  40. typedef    unsigned long    chtype;
  41.  
  42. #define    bool    char
  43. #define    reg    register
  44.  
  45. #define    TRUE    1
  46. #define    FALSE    0
  47. #define    ERR    0
  48. #define    OK    (1)
  49.  
  50. #define    _ENDLINE    001
  51. #define    _FULLWIN    002
  52. #define    _SCROLLWIN    004
  53. #define    _FLUSH        010
  54. #define    _CUROFF        020
  55. #define    _VSCROLL    040
  56.  
  57. #define A_CHARTEXT    0x00ff
  58. #define    A_ATTRIBUTES    0xff00
  59. #define    A_STANDOUT    0x0100
  60. #define    A_BLINK        0x0200
  61. #define    A_UNDERLINE    0x0400
  62. #define A_ATTR4        0x0800        /* USER DEFINED  */
  63. #define A_ATTR5        0x1000        /* USER DEFINED  */
  64. #define A_ATTR6        0x2000        /* USER DEFINED  */
  65. #define A_ATTR7        0x4000        /* USER DEFINED  */
  66. #define A_ATTR8        0x8000        /* USER DEFINED  */
  67.  
  68. /* for compatibility  */
  69.  
  70. #define _ATTRIBUTE    A_ATTRIBUTES
  71. #define _STANDOUT    A_STANDOUT    /* STANDOUT  */
  72. #define _BLINK        A_BLINK        /* BLINK     */
  73. #define _UNDERLIN    A_UNDERLINE    /* UNDERLINE  */
  74. #define ATTR1        A_STANDOUT    /* STANDOUT  */
  75. #define ATTR2        A_BLINK        /* BLINK     */
  76. #define ATTR3        A_UNDERLINE    /* UNDERLINE  */
  77. #define ATTR4        A_ATTR4
  78. #define ATTR5        A_ATTR5
  79. #define ATTR6        A_ATTR6
  80. #define ATTR7        A_ATTR7
  81. #define ATTR8        A_ATTR8
  82.  
  83. #define    _NOCHANGE    (-1)
  84. #define    _DELETE        (-1 & 0x8000)
  85. #define    _INSERT        (-1 & 0xC000)
  86. #define _INSDEL        (-1 & 0xE000)
  87.  
  88. #define    _puts(s)    tputs(s, 1, tputch)      
  89.  
  90. /*
  91.  * Capabilities from termcap
  92.  */
  93.  
  94.  
  95. extern bool     AM, BS, CA, DA, DB, EO, GT, HZ, IN, MI, MS, NC, OS, UL,
  96.         XN, XS;        
  97. extern char     *KK1, *KK2, *KK3, *KK4, *KK5, *AL,  *BC,  *BL,  *BT,  *CD,
  98.         *CE,  *CF,  *CL,  *CM,  *CO,  *CR,  *DC,  *DL,  *DM,  *DO,
  99.         *ED,  *EI,  *EN,  *HO,  *IC,  *IM,  *IP,  *K0,  *K1,  *K2, *K3,
  100.         *K4,  *K5,  *K6,  *K7,  *K8,  *K9,  *KAA, *KCC, *KDD, *KEE,
  101.         *KFF, *KHH, *KII, *KLL, *KMM, *KNN, *KPP, *KRR, *KSS, *KTT,
  102.         *KA,  *KB,  *KD,  *KE,  *KH,  *KL,  *KR,  *KS,  *KT,  *KU,
  103.         *LL,  *MA,  *MB,  *ME,  *ND,  *NL,  *SE,  *SF,  *SO,  *SR,
  104.         *TA,  *TE,  *TI,  *UC,  *UE,  *UP,  *US,  *VB,  *VE,  *VS,
  105.         *BB,  *BE,   PC;
  106. extern char    *A4S, *A4E,*A5S, *A5E, *A6S, *A6E, *A7S, *A7E, *A8S, *A8E;
  107. extern int    A4G, A5G, A6G, A7G, A8G, SG, UG;                
  108.  
  109. /*
  110.  * From the tty modes...
  111.  */
  112.  
  113. extern bool    NONL, UPPERCASE, normtty, _pfast;
  114.  
  115. struct _win_st {
  116.     short        _cury, _curx;
  117.     short        _maxy, _maxx;
  118.     short        _begy, _begx;
  119.     short        _flags;
  120.     bool        _clear;
  121.     bool        _leave;
  122.     bool        _scroll;
  123.     bool        _keypad;            /* Sys V Release 2  */
  124.     short        **_y;
  125.     short        *_ybase;
  126.     short        *_firstch;
  127.     short        *_lastch;
  128.     struct _win_st    *_nextp, *_orig;
  129. };
  130.  
  131. #define    WINDOW    struct _win_st
  132.  
  133.  
  134. extern WINDOW    *initscr(), *newwin _PARAMS((int, int, int, int)), *subwin _PARAMS((WINDOW *, int, int, int, int));
  135. extern char    *longname(), *getcap();
  136.  
  137. extern bool    My_term, _echoit, _rawmode, _kpadmode, _endwin;    
  138.  
  139. extern char    *Def_term, ttytype[];
  140.  
  141. extern int    LINES, COLS, _tty_ch, _res_flg;
  142.  
  143. extern SGTTY    _tty;
  144.  
  145. extern WINDOW    *stdscr, *curscr;
  146.  
  147.  
  148. /*
  149.  *    Define CURVOID to stop lint from generating "null effect"
  150.  *     comments.
  151.  */
  152. #ifdef __lint
  153. int    __void__;
  154. #define    CURVOID(x)    (__void__ = (int) (x))
  155. #else
  156. #define    CURVOID(x)    (x)
  157. #endif
  158.  
  159. /*
  160.  * psuedo functions for standard screen
  161.  */
  162. #define    addch(ch)    CURVOID(waddch(stdscr, ch))
  163. #define    getch()        CURVOID(wgetch(stdscr))
  164. #define    addstr(str)    CURVOID(waddstr(stdscr, str))
  165. #define    getstr(str)    CURVOID(wgetstr(stdscr, str))
  166. #define    move(y, x)    CURVOID(wmove(stdscr, y, x))
  167. #define    clear()        CURVOID(wclear(stdscr))
  168. #define    erase()        CURVOID(werase(stdscr))
  169. #define    clrtobot()    CURVOID(wclrtobot(stdscr))
  170. #define    clrtoeol()    CURVOID(wclrtoeol(stdscr))
  171. #define    insertln()    CURVOID(winsertln(stdscr))
  172. #define    deleteln()    CURVOID(wdeleteln(stdscr))
  173. #define    refresh()    CURVOID(wrefresh(stdscr))
  174. #define    inch()        CURVOID(winch(stdscr))
  175. #define    insch(c)    CURVOID(winsch(stdscr,c))
  176. #define    delch()        CURVOID(wdelch(stdscr))
  177.  
  178. #define    attron(a)    CURVOID(wattron(stdscr,a))
  179. #define    attroff(a)    CURVOID(wattroff(stdscr,a))
  180. #define    attrset(a)    CURVOID(wattrset(stdscr,a))
  181. #define    standout()    CURVOID(wattron(stdscr,A_STANDOUT))
  182. #define    standend()    CURVOID(wattroff(stdscr,A_STANDOUT))
  183. #define    wstandout(win)    CURVOID(wattron(win,A_STANDOUT))
  184. #define    wstandend(win)    CURVOID(wattroff(win,A_STANDOUT))
  185.  
  186. /*
  187.  * mv functions
  188.  */
  189. #define    mvwaddch(win,y,x,ch)    CURVOID(wmove(win,y,x)==ERR?ERR:waddch(win,ch))
  190. #define    mvwgetch(win,y,x)    CURVOID(wmove(win,y,x)==ERR?ERR:wgetch(win))
  191. #define    mvwaddstr(win,y,x,str)    CURVOID(wmove(win,y,x)==ERR?ERR:waddstr(win,str))
  192. #define mvwgetstr(win,y,x,str)  CURVOID(wmove(win,y,x)==ERR?ERR:wgetstr(win,str))
  193. #define    mvwinch(win,y,x)    CURVOID(wmove(win,y,x) == ERR ? ERR : winch(win))
  194. #define    mvwdelch(win,y,x)    CURVOID(wmove(win,y,x) == ERR ? ERR : wdelch(win))
  195. #define    mvwinsch(win,y,x,c)    CURVOID(wmove(win,y,x) == ERR ? ERR:winsch(win,c))
  196. #define    mvaddch(y,x,ch)        mvwaddch(stdscr,y,x,ch)
  197. #define    mvgetch(y,x)        mvwgetch(stdscr,y,x)
  198. #define    mvaddstr(y,x,str)    mvwaddstr(stdscr,y,x,str)
  199. #define mvgetstr(y,x,str)       mvwgetstr(stdscr,y,x,str)
  200. #define    mvinch(y,x)        mvwinch(stdscr,y,x)
  201. #define    mvdelch(y,x)        mvwdelch(stdscr,y,x)
  202. #define    mvinsch(y,x,c)        mvwinsch(stdscr,y,x,c)
  203.  
  204. /*
  205.  * psuedo functions
  206.  */
  207. #define    clearok(win,bf)     (win->_clear = bf)
  208. #define    leaveok(win,bf)     (win->_leave = bf)
  209. #define    scrollok(win,bf) (win->_scroll = bf)
  210. #define    keypad(win,bf)     (win->_keypad = bf)    
  211. #define flushok(win,bf)     (bf ? (win->_flags |= _FLUSH):(win->_flags &= ~_FLUSH))
  212. #define tscroll(win,bf)     (bf ? (win->_flags |= _VSCROLL):(win->_flags &= ~_VSCROLL))
  213. #define autoflush(bf)     (bf ? (curscr->_flags |= _FLUSH):(curscr->_flags &= ~_FLUSH))
  214. #define    getyx(win,y,x)     y = win->_cury, x = win->_curx
  215. #define getorg(win,y,x)  y = win->_begy, x = win->_begx
  216. #define getdim(win,y,x)  y = win->_maxy, x = win->_maxx
  217. #define is_standout(win) (win->_flags & A_STANDOUT)
  218. #define is_blinkon(win)     (win->_flags & A_BLINK)
  219. #define is_underlin(win) (win->_flags & A_UNDERLINE)
  220. #define is_attr1on(win)     (win->_flags & A_ATTR1)
  221. #define is_attr2on(win)     (win->_flags & A_ATTR2)
  222. #define is_attr3on(win)     (win->_flags & A_ATTR3)
  223. #define is_attr4on(win)     (win->_flags & A_ATTR4)
  224. #define is_attr5on(win)     (win->_flags & A_ATTR5)
  225. #define is_attr6on(win)     (win->_flags & A_ATTR6)
  226. #define is_attr7on(win)     (win->_flags & A_ATTR7)
  227. #define is_attr8on(win)     (win->_flags & A_ATTR8)
  228. #define is_curoff()     (curscr->_flags & _CUROFF)
  229. #define    winch(win)     (win->_y[win->_cury][win->_curx])
  230.  
  231. #define is_delok(w)     (DL&&((w->_flags & _VSCROLL)||((w->_maxx==COLS)&&((w->_begy+w->_maxy)==LINES))))
  232.  
  233. #define is_insok(w)     (AL&&((w->_flags & _VSCROLL)||((w->_maxx==COLS)&&((w->_begy+w->_maxy)==LINES))))
  234.  
  235. #define PROCMDS        2
  236. #define KEY_UNUSED    (-1)
  237.  
  238. /*
  239.  *    System V Release 2 curses function key defines 
  240.  */
  241.  
  242. #define KEY_BREAK    0401        /* break key (unreliable)  */
  243. #define KEY_DOWN    0402        /* The four arrow keys ...  */
  244. #define KEY_UP        0403
  245. #define KEY_LEFT    0404
  246. #define KEY_RIGHT    0405        /* ...  */
  247. #define KEY_HOME    0406        /* Home key (upward+left arrow)  */
  248. #define KEY_BS        0407        /* backspace (unreliable)  */
  249. #define KEY_F0        0410        /* Function keys.  Space for 64  */
  250. #define KEY_F(n)    (KEY_F0+(n))    /* keys is reserved.  */
  251. #define KEY_DL        0510        /* Delete line  */
  252. #define KEY_IL        0511        /* Insert line  */
  253. #define KEY_DC        0512        /* Delete character  */
  254. #define KEY_IC        0513        /* Insert char or enter insert mode  */
  255. #define KEY_EIC        0514        /* Exit insert char mode  */
  256. #define KEY_CLEAR    0515        /* Clear screen  */
  257. #define KEY_EOS        0516        /* Clear to end of screen  */
  258. #define KEY_EOL        0517        /* Clear to end of line  */
  259. #define KEY_SF        0520        /* Scroll 1 line forward  */
  260. #define KEY_SR        0521        /* Scroll 1 line backwards (reverse)  */
  261. #define KEY_NPAGE    0522        /* Next page  */
  262. #define KEY_PPAGE    0523        /* Previous page  */
  263. #define KEY_STAB    0524        /* Set tab  */
  264. #define KEY_CTAB    0525        /* Clear tab  */
  265. #define KEY_CATAB    0526        /* Clear all tabs  */
  266. #define KEY_ENTER    0527        /* Enter or send (unreliable)  */
  267. #define KEY_SRESET    0530        /* soft (partial) reset (unreliable)  */
  268. #define KEY_RESET    0531        /* reset or hard reset (unreliable)  */
  269. #define KEY_PRINT    0532        /* print or copy  */
  270. #define KEY_LL        0533        /* home down or bottom (lower left)  */
  271.                     /* The keypad is arranged like this:  */
  272.                     /* a1    up    a3    */
  273.                     /* left   b2  right   */
  274.                     /* c1   down   c3    */
  275. #define KEY_A1        0534        /* upper left of keypad  */
  276. #define KEY_A3        0535        /* upper right of keypad  */
  277. #define KEY_B2        0536        /* center of keypad  */
  278. #define KEY_C1        0537        /* lower left of keypad  */
  279. #define KEY_C3        0540        /* lower right of keypad  */
  280. #define KEY_BACKSPACE KEY_BS
  281.  
  282. #pragma    pack()
  283.  
  284. #endif    /* _TCAP_H  */
  285.